package schoolDemo3;
//方法的重载
class CyLinder10_13{
    private double radius;
    private int height;
    private double pi=3.14;
    private String color;

    public double setCyLinder(double r,int h){
        radius=r;
        height=h;
        return r+h;
    }
    public void setCyLinder(String str){
        color=str;
    }
    public void show (){
        System.out.println("该圆柱体的颜色为："+this.color);
    }
    double area(){
        return pi*radius*radius;
    }
    double volume(){
        return area()*height;
    }
}
public class APP7_3 {
    public static void main(String[] args){
        double r_h;
        CyLinder10_13 volu=new CyLinder10_13();
        r_h=volu.setCyLinder(2.5,5);
        volu.setCyLinder("红色");
        System.out.println("圆柱底半径与高之和="+r_h);
        System.out.println("圆柱体体积="+volu.volume());
        volu.show();
    }
}
